package com.tanjie.blackbean.pojo.response;

/**
 * @author: tanjie
 * @date: 2022-03-30
 **/
public enum AuthErrorCode implements IResult {

    DEFAULT("authentication invalid"),

    USERNAME_OR_PWD_BLANK("用户名和密码不能为空"),

    USERNAME_OR_PWD_WRONG("用户名或密码错误"),

    USER_FORBIDDEN("当前用户已被禁用"),

    TOKEN_BLANK("token is blank"),

    TOKEN_INVALID("token is invalid"),

    CANNOT_GET_USERINFO_FROM_TOKEN("无法从token中获取到用户信息"),

    CANNOT_GET_USERINFO_FROM_CACHE("无法从cache中获取到用户信息"),

    NO_ACCESS("无访问权限");

    AuthErrorCode(String message, Integer code) {
        this.message = message;
        this.code = code;
    }

    AuthErrorCode(String message) {
        this.message = message;
        this.code = -4;
    }

    final String message;

    final Integer code;

    @Override
    public String getMessage() {
        return this.message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

}
